package com.vrv.app.cyberspace.modules.sys.controller;


import com.vrv.app.cyberspace.common.utils.JSONResult;
import com.vrv.app.cyberspace.modules.sys.entity.RoleTable;
import com.vrv.app.cyberspace.modules.sys.service.IRoleTableService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import static com.vrv.app.cyberspace.common.utils.JSONResult.renderSuccess;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author sm
 * @since 2017-12-15
 */
@Api(description = "用户角色")
@RestController
@RequestMapping("/sys/role")
public class RoleTableController extends BaseController {
    @Autowired
    private IRoleTableService roleTableService;

    @GetMapping("/{id}")
    public JSONResult getRole(@PathVariable Integer id) {
        return renderSuccess(roleTableService.selectById(id));
    }

    @GetMapping()
    public JSONResult getListRole() {
        return renderSuccess(roleTableService.selectList(null));
    }
}

